package com.lt.interactive.wechat.config;

public class WxUrlConfig{
    /**
     * 网页授权
     */
    public String getOauthAccessToken(String code,String wxMpAppId,String wxMpAppSecret) {
        return "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + wxMpAppId + "&secret=" + wxMpAppSecret+ "&code=" + code + "&grant_type=" + WxConstant.GRANT_TYPE;
    }

    /**
     * 微信用户详细信息 accessToken:网页授权accessToken openId:用户openid 通过授权获取
     */
    public String getUserInfo(String accessToken, String openId) {
        return "https://api.weixin.qq.com/sns/userinfo?access_token=" + accessToken.trim() + "&openid=" + openId.trim()+ "&lang=zh_CN";
    }

    /**
     * 微信web登录url  生成微信二维码的方法
     */
    public String getWxWebLoginUrl(String type,String redirectUrl,String param,String wxOpenAppId){
        return "https://open.weixin.qq.com/connect/qrconnect?appid="+wxOpenAppId+"&redirect_uri="+redirectUrl+"&response_type=code&scope="+type+"&state="+param+"#wechat_redirect";
    }


}
